package com.gdut.sport.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBOpenHelper extends SQLiteOpenHelper {

    private static final String DATABASE_NAME = "sp.db";
    private static final int DATABASE_VERSION = 1;

    private static final String CREATE_HISTORY_TABLE = "create table if not exists history(" +
            "id integer primary key autoincrement," +
            "distance double," +
            "time char(10)," +
            "createdAt char(20)" +
            ")";

    public DBOpenHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_HISTORY_TABLE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
